# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=upower
pkgver=1.90.5
pkgrel=3
pkgdesc="Power Management Services"
url="https://upower.freedesktop.org"
arch="all"
license="GPL-2.0-or-later"
makedepends="
	docbook-xsl
	eudev-dev
	glib-dev
	gobject-introspection-dev
	gtk-doc
	libgudev-dev
	libxslt
	meson
	"
checkdepends="
	dbus
	py3-dbus
	py3-dbusmock
	py3-gobject3
	py3-packaging
	umockdev-dev
	"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
source="https://gitlab.freedesktop.org/upower/upower/-/archive/v$pkgver/upower-v$pkgver.tar.bz2"
builddir="$srcdir/$pkgname-v$pkgver"

build() {
	abuild-meson \
		-Db_lto=true \
		-Dsystemdsystemunitdir=no \
		. output
	meson compile -C output
}

check() {
	meson test -t 5 --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

sha512sums="
53fe3c3d58a2d7d2ec322620aae3c328dae6402cbd97b24648f12ef862579d4110bb09f746457b6eafa1f24ba2311249216cf84e4a307eeaee152d110787fd56  upower-v1.90.5.tar.bz2
"
